#include <stdio.h>

int main(int argc, char *argv[]) {

    double consumption=0.00, payment;

    scanf("%lf", &consumption);
    if (consumption<500)
    {
        payment = consumption * 1;
        printf("%.2lf", payment);
    }else if (500<=consumption&&consumption<1000)
    {
        payment = consumption * 0.95;
        printf("%.2lf", payment);
    }else if (1000<=consumption&&consumption<3000)  
    {
        payment = consumption * 0.90;
        printf("%.2lf", payment);
    }else if (3000<=consumption&&consumption<5000)
    {
        payment = consumption * 0.85;
        printf("%.2lf", payment);
    }else if (consumption>=5000)
    {
       payment = consumption * 0.80;
        printf("%.2lf", payment);
    }else{
        printf("未知错误");
    }

    return 0;
}